import Axios from '../plugins/axios'
import { HTTPTypes } from './type'
import { baseURL } from './config'

export class EnterpriseRequest {
  /**
   * 获取企业
   * @param params
   * @returns
   */
  static async getEnterprise(): Promise<HTTPTypes['res']> {
    return Axios.post(`${baseURL}/uc/api/account/enterprise/getEnterprises`)
  }

  /**
   * 获取企业详情
   * @param id
   * @returns
   */
  static async getEnterpriseDetail(id?: number): Promise<HTTPTypes['res']> {
    return Axios.get(`${baseURL}/uc/api/account/enterprise/getEnterpriseDetail/${id}`)
  }

  /**
   * 更新企业信息
   * @param params
   * @returns
   */
  static async updateEnterprise(params?: HTTPTypes['req']): Promise<HTTPTypes['res']> {
    return Axios.post(`${baseURL}/uc/api/account/enterprise/updateEnterprise`, params)
  }
}
